cmake_minimum_required(VERSION 3.7)
project(cplusstd)

set(CMAKE_CXX_STANDARD 11)
#set(Boost_INCLUDE_DIR /usr/local/include/boost)
#set(Boost_LIBRARY_DIR /user/local/lib)
#find_package(Boost COMPONENTS system filesystem REQUIRED)
#include_directories(${Boost_INCLUDE_DIR})
#link_directories(${Boost_LIBRARY_DIR})
find_package(Boost)
IF (Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIR})
endif()

set (Boost_USE_STATIC_LIBS ON) # enable dynamic linking
set (Boost_USE_MULTITHREAD ON)  # enable multithreading
find_package (Boost COMPONENTS REQUIRED thread)

# 设置 编译的文件是那一个
set(SOURCE_FILES usingboost.cpp)
add_executable(cplusstd ${SOURCE_FILES})
target_link_libraries(cplusstd boost_thread)